<div class="box">

    <div class="box-header">

        <div class="row">
            <div class="col-sm-5">
                <ob_link><a class="btn export" url="{:url('exportMoneyappList')}"><i class="fa fa-download"></i> 导 出</a></ob_link>
            </div>

            <div class="col-sm-7">
                <div class="box-tools search-form pull-right">
                    <div class="input-group input-group-sm">

                        <input type="text" name="search_data" style="width: 200px;" class="form-control pull-right" value="{:input('search_data')}" placeholder="支持昵称|用户名|开户名">
                        <select name="stat" class="pull-right form-control" style="width:120px">
                            <option value='9'>提现状态</option>
                            <option value='0'>待审核</option>
                            <option value='1'>已通过</option>
                            <option value='2'>已拒绝</option>
                        </select>
                        <div class="input-group-btn">
                            <button type="button" id="search"  url="{:url('moneyappList')}" class="btn btn-info btn-flat"><i class="fa fa-search"></i></button>
                        </div>

                    </div>
                </div>
            </div>
        </div>

    </div>


    <div class="box-body table-responsive">
        <table  class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>ID</th>
                <th>提现日期</th>
                <th>用户</th>
                <th>开户银行</th>
                <th>开户信息</th>
                <th>银行卡号</th>
                <th>提现金额</th>
                <th>手续费</th>
                <th>实际到账</th>
                <th>状态</th>
                <th>备注</th>
                <th>操作</th>
            </tr>
            </thead>

            {notempty name='list'}
            <tbody>
            {volist name='list' id='vo'}
            <tr>
                <td>{$vo.id}</td>
                <td>{$vo.create_time}</td>
                <td>{$vo.username}<br/>{$vo.name}</td>
                <td>{$vo.bankName}</td>
                <td>{$vo.bankUser}<br/>{$vo.phone}</td>
                <td>{$vo.bank}</td>
                <td><a href="{:url('user/moneyyj', array('user_id' => $vo['user_id']))}" >{$vo.money}</a></td>
                <td>{$vo.moneyTax}</td>
                <td>{$vo.moneyMy}</td>
                <td>
                    {if $vo.stat == 0}<span style="color:red">待审核<span>{/if}{if $vo.stat == 1}<span style="color:green">已通过</span>{/if}{if $vo.stat == 2}已拒绝{/if}
                </td>
                <td>{$vo.words}</td>
                <td>
                    {if $vo.stat==0}<ob_link><a class="btn "  onclick="pass({$vo.id},1)"><i class="fa fa-edit"></i>通过</a></ob_link>   <ob_link><a class="btn "  onclick="pass({$vo.id},2)"><i class="fa fa-warning"></i>拒绝</a></ob_link>{/if}
                </td>
            </tr>
            {/volist}
            </tbody>
            {else/}
            <tbody><tr class="odd"><td colspan="8" class="text-center" valign="top">{:config('empty_list_describe')}</td></tr></tbody>
            {/notempty}
        </table>
    </div>
    <div class="box-footer">
        <a class="btn" onclick="javascript:history.back(-1);return false;"><i class="fa fa-history"></i> 返 回</a>
    </div>
    <div class="box-footer clearfix text-center">
        {$list->render()}
    </div>

</div>

<script>
    //导出功能
    $(".export").click(function(){
        window.location.href = searchFormUrl($(".export"));
    });
    function pass(id,stat){
        if(confirm('是否确认此操作')){
            if(stat == 1){
                $.post("{:url('updateStat')}",{id:id,stat:stat},function(data){
                    if(data.error == 0){
                        layer.msg(data.msg, {icon: 6});
                        location.reload();
                    }else{
                        layer.alert(data.msg, {icon: 5});
                    }
                },'json');
            }else{
                layer.prompt({title: '请输入拒绝理由，并确认', formType: 2}, function(text, index){
                    $.post("{:url('updateStat')}",{id:id,stat:stat,words:text},function(data){
                        if(data.error == 0){
                            layer.msg(data.msg, {icon: 6});
                            location.reload();
                        }else{
                            layer.alert(data.msg, {icon: 5});
                        }
                    },'json');
                });
            }
        }
    }
</script>